using System;
using System.Data;

namespace Soccer.Core
{
    public class PropertyAttribute: Attribute
    {
        private bool _IsPrimaryKey = false;
        public bool IsPrimaryKey
        {
            get { return _IsPrimaryKey; }
            set { _IsPrimaryKey = value; }
        }

        private bool _IsIdentity = false;
        public bool IsIdentity
        {
            get { return _IsIdentity; }
            set { _IsIdentity = value; }
        }

        private bool _NullAble = false;
        public bool NullAble
        {
            get { return _NullAble; }
            set { _NullAble = value; }
        }

        private int _MaxLength;
        public int MaxLength
        {
            get { return _MaxLength; }
            set { _MaxLength = value; }
        }

        private TypeCode _TypeCode;
        public TypeCode TypeCode
        {
            get { return _TypeCode; }
            set { _TypeCode = value; }
        }

        private string _ErrorResourceKey;
        public string ErrorResourceKey
        {
            get { return _ErrorResourceKey; }
            set { _ErrorResourceKey = value; }
        }

        public PropertyAttribute(TypeCode typeCode, int maxSize)
        {
            this.MaxLength = maxSize;
            this.TypeCode = typeCode;
        }

        public PropertyAttribute(TypeCode typeCode, int maxSize, bool isPrimaryKey, bool isIdentity)
        {
            this.MaxLength = maxSize;
            this.TypeCode = typeCode;
            this.IsPrimaryKey = isPrimaryKey;
            this.IsIdentity = isIdentity;
        }

        public PropertyAttribute(TypeCode typeCode, int maxSize, bool isPrimaryKey, bool isIdentity, bool nullAble)
        {
            this.MaxLength = maxSize;
            this.TypeCode = typeCode;
            this.IsPrimaryKey = isPrimaryKey;
            this.IsIdentity = isIdentity;
            this.NullAble = nullAble;
        }

        public PropertyAttribute(TypeCode typeCode, int maxSize, bool isPrimaryKey, bool isIdentity, bool nullAble, string errorMessage)
        {
            this.MaxLength = maxSize;
            this.TypeCode = typeCode;
            this.IsPrimaryKey = isPrimaryKey;
            this.IsIdentity = isIdentity;
            this.NullAble = nullAble;
            this.ErrorResourceKey = errorMessage;
        }
    }
}
